package ch07.dao.sysUser.Impl;

import ch07.dao.sysUser.SysUserMapper;
import ch07.pojo.SysUser;
import org.mybatis.spring.SqlSessionTemplate;
import org.mybatis.spring.support.SqlSessionDaoSupport;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;



public class SysUserMapperImpl  implements SysUserMapper {
    private SqlSessionTemplate sqlSession;


    @Override
    public List<SysUser> selectSysUserList(SysUser sysUser) {
        return sqlSession.selectList(
                "ch07.dao.sysUser.SysUserMapper.selectSysUserList",sysUser
        );
    }

    @Override
    public int add(SysUser sysUser) {
        return sqlSession.insert(
                "ch07.dao.sysUser.SysUserMapper.add",sysUser
        );
    }

    public SqlSessionTemplate getSqlSession() {
        return sqlSession;
    }

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }
}
